package com.baor.controller;


import com.baor.domain.FinanceVo;
import com.baor.service.FinanceService;
import com.baor.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/finance")
public class FinanceController {

    @Autowired
    private FinanceService financeService;

    @RequestMapping("/financeList")
    public AjaxResult<?> list(@RequestBody Map<String,Object> params){
        return financeService.financeList(params);
    }

    @RequestMapping("/addFinance")
    public AjaxResult<?> insert(@RequestBody FinanceVo financeVo){
        return financeService.insert(financeVo);
    }

    @RequestMapping("/updateFinance")
    public AjaxResult<?> update(@RequestBody FinanceVo financeVo){
        return financeService.update(financeVo);
    }

    @RequestMapping("/delete")
    public AjaxResult<?> delete(Integer financeId){
        return financeService.delete(financeId);
    }

    @RequestMapping("/search")
    public AjaxResult<?> search(@RequestBody FinanceVo financeVo){
        return financeService.search(financeVo);
    }
}
